package com.googlecode.bluetools.common.security;

import java.security.Provider;
import java.security.Security;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

/**
 * 
 */
public class SecurityUtil {

	static {
		initProviders();
	}

	/**
	 * init the providers by name
	 */
	public static void initProviders() {
		Provider provider = Security.getProvider("BC");
		if (provider == null) {
			provider = new BouncyCastleProvider();
			Security.addProvider(provider);
		}
	}

	/**
	 * @return the bc provider
	 * @see #initProviders()
	 */
	public static Provider getBCProvider() {
		return Security.getProvider("BC");
	}

}
